<!DOCTYPE html>
<html lang="zh-cn" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<head th:replace="common::head"></head>
<body>
<div th:replace="common::top"></div>
<br/>
<h2>订单列表</h2>
<br/>
<table>
    <thead>
    <tr>
        <th>编号</th>
<!--        <th>订单编号</th>-->
        <th>客户</th>
        <th>总量</th>
        <th>生产</th>
        <th>发货</th>
        <th>回款</th>
        <th>销售</th>
        <th>创建时间</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="item : ${page.getList()}" th:class="${item.status}==0?'del':''">
        <td><a th:href="@{detail.html(orderId=${item.getId()})}"
               th:text="${item.code}"></a></td>
<!--        <td><a th:href="@{detail.html(orderId=${item.getId()})}"
               th:text="${item.getCode()}"></a></td> -->
        <td th:text="${item.customName}"></td>
        <td th:text="${item.orderNum}"></td>
        <td><progress th:if="${item.confirm}" th:max="${item.orderNum}" th:value="${item.produceNum}"></progress></td>
        <td><progress th:if="${item.confirm}" th:max="${item.orderNum}" th:value="${item.sendNum}"></progress></td>
        <td><progress th:if="${item.confirm}" th:max="${item.contractAmount}" th:value="${item.actualAmount}"></progress></td>
        <!--td>
            <b th:each="stage:${item.stages}" th:text="${stage.value}" th:style="'color:'+${stage.color}"></b>
        </td-->
        <td th:text="${item.createUser}"></td>
        <td th:text="${#dates.format(item.getCreateTime(), 'yyyy-MM-dd')}"></td>
        <td>
            <a th:if="${item.status}!=0" th:href="@{edit.html(orderId=${item.getId()})}">编辑</a>
            <a th:href="@{detail.html(orderId=${item.getId()})}">详情</a>
            <a th:href="@{money.html(orderId=${item.getId()})}">收支</a>
        </td>
    </tr>
    </tbody>
</table>
<div>
    <a><b th:text="'第 '+${page.curPage}+'/'+${page.getLastPage()}+' 页'"></b></a>
    <a th:href="@{/finance/list.html(page=${page.getFirstPage()})}">首页</a>
    <a th:if="${page.getPrePage()>0}"
       th:href="@{/finance/list.html(page=${page.getPrePage()})}">上一页</a>
    <a th:if="${page.getNextPage()>0}"
       th:href="@{/finance/list.html(page=${page.getNextPage()})}">下一页</a>
    <a th:href="@{/finance/list.html(page=${page.getLastPage()})}">尾页</a>
</div>
<p><a href="../index.html" th:href="@{/index.html}">返回主页</a></p>
</body>
</html>
